<?php

namespace App\Http\Controllers;

use App\Models\Address;
use Illuminate\Http\Request;

class TestController extends Controller
{
    public function index($id)
    {
       $res = Address::where('mac_address',$id)->first();
       if($res){
           $res->updated_at = now();
           $res->save();
           return response()->json($res->status);
       }
        Address::create([
            'mac_address' => $id,
            'user_id' => 1,
            'created_at' => now(),
            'updated_at' => now(),
        ]);
        return response()->json(0);
    }
}
